package com.cvic.se.config;

import java.time.LocalDate;

import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;

@Component
public class MyMetaObjectHandler implements MetaObjectHandler{

	@Override
	public void insertFill(MetaObject metaObject) {
		//为字段"createDate"填充当前时间
		this.strictInsertFill(metaObject, "createDate", LocalDate.class, LocalDate.now());
		
	}

	@Override
	public void updateFill(MetaObject metaObject) {
		this.strictInsertFill(metaObject, "createDate", LocalDate.class, LocalDate.now());
	}

}
